<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>沟通,了解心仪的职位</title>
    <link rel="stylesheet" href="/dev/plugins/layui/layui/css/layui.css">
    <link rel="stylesheet" href="/dev/plugins/bootstrap/css/bootstrap.css">
    <link rel="stylesheet" href="/dev/assets/css/job/page/jobfromchat.css">
    <link rel="icon" href="/dev/assets/img/geek-job/wanli.jpg" type="image/x-icon">
    <script>
        e();

        function e() {
            // 在这里执行条件检查
            let token = localStorage.getItem("token")
            if (token == null) {
                // 执行页面跳转
                window.location.href = '/dev/views/job/page/login.html';
            }
        }
    </script>
    <style>
        .compileJS{
            background-color: #acceff;
            border-radius: 10px;
        }
    </style>
</head>
<body>
<div id="nav"></div>
<div id="wrap" class="has-header has-footer">
    <div data-v-e2a11294="" id="main" class="inner home-inner" headerrander="true">
        <div data-v-e2a11294="" id="container" class="ucenter-container">
            <div data-v-e2a11294="" class="user-sider">
                <div data-v-e2a11294="">
                    <div data-v-7d3f5d0c="" class="sider-box userinfo-box">
                        <div data-v-7d3f5d0c="" class="container">
                            <div data-v-7d3f5d0c="" class="headbox">
                                <div data-v-7d3f5d0c="" class="sex man"></div>
                                <img data-v-7d3f5d0c=""
                                     src="https://img.bosszhipin.com/boss/avatar/avatar_15.png" alt=""
                                     class="headimg">
                            </div>
                            <div data-v-7d3f5d0c="" class="content">
                                <div data-v-7d3f5d0c="" class="username"><span data-v-7d3f5d0c=""
                                                                               class="username">赵建云</span></div>
                                <div data-v-7d3f5d0c="" class="userinfo"> 23岁 <i data-v-7d3f5d0c=""
                                                                                 class="vline"></i> 24年应届生 <i
                                        data-v-7d3f5d0c="" class="vline"></i> 本科
                                </div>
                            </div>
                        </div>
                        <div data-v-7d3f5d0c="" class="btn-ops">
                            <div data-v-7d3f5d0c="" class="now-state">
                                <div data-v-7d3f5d0c="" class="ui-select ui-select-single" style="width: 100%;">
                                    <div tabindex="0" class="ui-select-selection"><input type="hidden" value="1">
                                        <div class="ui-select-inner"><span
                                                class="ui-select-selected-value">在校-暂不考虑</span><!----><!----><i
                                                class="ui-icon-arrow-down"></i></div>
                                    </div>
                                    <div class="ui-select-dropdown" style="display: none;">
                                        <ul class="ui-dropdown-not-found" style="display: none;">
                                            <li>无匹配数据</li>
                                        </ul>
                                        <ul class="ui-dropdown-list">
                                            <li data-v-7d3f5d0c="" class="ui-select-item">离校-随时到岗</li>
                                            <li data-v-7d3f5d0c="" class="ui-select-item ui-select-item-selected">
                                                在校-暂不考虑
                                            </li>
                                            <li data-v-7d3f5d0c="" class="ui-select-item">在校-考虑机会</li>
                                            <li data-v-7d3f5d0c="" class="ui-select-item">在校-月内到岗</li>
                                        </ul>
                                        <ul class="ui-dropdown-loading" style="display: none;">加载中</ul>
                                    </div>
                                </div>
                            </div>
                            <a data-v-7d3f5d0c="" href="javascript:;"
                               class="edit-userinfo" ka="base_info_edit" type="desktop" lay-on="page-title">编辑</a>
                        </div>
                        <div data-v-7d3f5d0c="" class="user-stat"><a data-v-7d3f5d0c=""
                                                                     href="/dev/views/job/page/jobfromchat.html?page=1"
                                                                     class="" ka="user_stat_bottom_added"
                                                                     type="desktop"><b data-v-7d3f5d0c="">8</b>沟通过
                        </a><a data-v-7d3f5d0c=""
                               href="/dev/views/job/page/jobfromchat.html?page=2" class=""
                               ka="user_stat_bottom_submitted" type="desktop"><b data-v-7d3f5d0c="">0</b>已投递 </a><a
                                data-v-7d3f5d0c="" href="/dev/views/job/page/jobfromchat.html?page=3" class=""
                                ka="user_stat_bottom_interview" type="desktop"><b data-v-7d3f5d0c="">0</b>面试 </a><a
                                data-v-7d3f5d0c="" href="/dev/views/job/page/jobfromchat.html?page=4" class=""
                                ka="user_stat_bottom_interest" type="desktop"><b data-v-7d3f5d0c="">0</b>感兴趣 </a>
                        </div>
                    </div>
                    <div data-v-c28f1a02="">

                        <div data-v-c28f1a02="" class="sider-box resume-online">
                            <h3 data-v-c28f1a02="" class="title">在线简历</h3>
                            <div data-v-c28f1a02="" class="edit-container">
                                <a href="/dev/views/job/page/resume.html" class="edit" type="desktop">编辑</a>
                                <div data-v-c28f1a02="" class="arrow"></div>
                            </div>
                        </div><!---->
                    </div>
                </div>
            </div>
            <div data-v-e2a11294="" class="user-jobs-area user-jobs-area-box-wrap">
                <div data-v-e2a11294="" class="chat-history-wrap chat-history-box-wrap">
                    <div data-v-e2a11294="" class="job-tab user-jobs-tab-nav">
                        <div data-v-e2a11294="" class="tab-back">
                            <div data-v-e2a11294="" class="icon-back"></div>
                            <span data-v-e2a11294="" onclick="back()">返回</span>
                        </div>
                        <span data-v-e2a11294="" ka="personal_top_added" class="">沟通过</span><span
                            data-v-e2a11294="" ka="personal_top_submitted" class="">已投递</span><span
                            data-v-e2a11294="" ka="personal_top_interview" class="">面试</span><span
                            data-v-e2a11294="" ka="personal_top_interest" class="">感兴趣</span>
                    </div><!---->
                    <div data-v-e2a11294="" class="data-tips">
                        <div data-v-e2a11294="" class="tip-inner">
                            <p data-v-e2a11294="" class="gray"><i class="layui-icon layui-icon-loading"></i> 正在加载中...
                            </p>
                        </div>
                    </div>
                    <div data-v-e2a11294="" class="pagination-area">
                        <div data-v-e2a11294="" class="pager text-center"><!---->
                            <div id="options-pages">

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div id="footer-wrapper">
        <div>
            <!-- 底部 -->

        </div><!---->
    </div>
    <!--  插入内容-->
    <!--  <ul data-v-e2a11294="" class="user-jobs-ul">-->
    <!--    <li data-v-e2a11294="" class="item-boss">-->
    <!--      <div data-v-e2a11294="" class="item-content">-->
    <!--        <div data-v-e2a11294="" class="info-header">&lt;!&ndash;&ndash;&gt;-->
    <!--          <div data-v-e2a11294="" class="btns">&lt;!&ndash;&ndash;&gt;<a data-v-e2a11294="" href="javascript:;"-->
    <!--                                                         ka="personal_interest_continue_7c87cffde6b7e1411nR83Ny4EFpS"-->
    <!--                                                         class="btn btn-startchat">继续沟通</a>&lt;!&ndash;&ndash;&gt;<a data-v-e2a11294="" href="javascript:;"-->
    <!--                                                                                                         ka="personal_interest_cancel_7c87cffde6b7e1411nR83Ny4EFpS"-->
    <!--                                                                                                         class="btn btn-like">取消感兴趣</a>&lt;!&ndash;&ndash;&gt;</div>-->
    <!--          <div data-v-e2a11294="" class="img-box"><img data-v-e2a11294=""-->
    <!--                                                       src="https://img.bosszhipin.com/beijin/upload/tmp/20220302/a2f3e71d9181a67bb20ef1f1c7589e9e1ba408a1a614bdac01cf85c72df890d1865f1d3f9ab655e3_s.jpg">-->
    <!--            <h3 data-v-e2a11294="" class="name"> 季立<em data-v-e2a11294="" class="vline"></em>高级经理&lt;!&ndash;&ndash;&gt;-->
    <!--            </h3>-->
    <!--          </div>-->
    <!--        </div>-->
    <!--        <div data-v-e2a11294="" class="info-primary flex-reverse info-primary-noninterview">-->
    <!--          <div data-v-e2a11294="" class="company-info"><img data-v-e2a11294=""-->
    <!--                                                            src="https://img.bosszhipin.com/beijin/upload/com/logo/20200421/3b0aca6d28c834c8756083634214ba1a41fcb4d88840e71ae8a97aec0165f768.jpg">-->
    <!--            <div data-v-e2a11294="" class="text"><b data-v-e2a11294=""><a data-v-e2a11294=""-->
    <!--                                                                          href="/gongsi/4e688f26febb7b191HVy29W7.html?ka=personal_interest_brand_4e688f26febb7b191HVy29W7"-->
    <!--                                                                          ka="personal_interest_brand_4e688f26febb7b191HVy29W7">爱开客</a></b>-->
    <!--              <p data-v-e2a11294="" class="gray"><span data-v-e2a11294="">通信/网络设备</span><span-->
    <!--                      data-v-e2a11294="">A轮</span><span data-v-e2a11294="">20-99人</span></p>-->
    <!--            </div>-->
    <!--          </div>-->
    <!--          <div data-v-e2a11294="" class="job-info width-500">-->
    <!--            <div data-v-e2a11294="" class="job-name">-->
    <!--              <div data-v-e2a11294="" class="flex"><a data-v-e2a11294=""-->
    <!--                                                      href="/job_detail/168d53d87d61e2c41XJ43N&#45;&#45;ElVQ.html?ka=personal_interest_job_168d53d87d61e2c41XJ43N&#45;&#45;ElVQ"-->
    <!--                                                      class="name"><span data-v-e2a11294="">java后端开发工程师</span><span data-v-e2a11294=""-->
    <!--                                                                                                                           class="location">[苏州·苏州工业园区·独墅湖]</span></a></div>-->
    <!--            </div>-->
    <!--            <p data-v-e2a11294="" class="gray"> 10-15K <span data-v-e2a11294="">3-5年</span> <span-->
    <!--                    data-v-e2a11294="">本科</span></p>-->
    <!--          </div>-->
    <!--        </div>-->
    <!--      </div>-->
    <!--    </li>-->
    <!--  </ul>-->


    <!--  <div data-v-e2a11294="">-->
    <!--    <div data-v-e2a11294="" class="data-blank-wrap data-blank-empty-wrap">-->
    <!--      <div class="data-tip">-->
    <!--        <div class="data-blank"><i class="tip-empty"></i><b data-v-e2a11294=""-->
    <!--                                                            class="blank-txt">暂时未有关注的职位，建议尝试查看推荐职位</b>-->
    <!--          <p class="goto-system"><span ka="personal_interest_recommend" class="btn">查看推荐职位</span></p>-->
    <!--        </div>-->
    <!--      </div>-->
    <!--    </div>-->
    <!--  </div>-->

    <!-- <div class="side-bar-box">
        <div class="side-bar-wrapper"><a href="javascript:;" title="返回顶部" class="back-top"></a>
            <ul class="side-bar-bottom">
                <li class="side-feedback"><a href="javascript:;"></a><span class="side-attr">反馈</span></li>
            </ul>
            <ul class="side-bar-top">
                <li class="side-interest"><a href="javascript:;" ka="side_interest"></a><span
                        class="side-popper">感兴趣</span></li>
                <li class="side-chat"><a href="javascript:;" ka="side_chat"></a><span class="side-popper">沟通过</span>
                </li>
                <li class="side-deliver"><a href="javascript:;" ka="side_deliver"></a><span
                        class="side-popper">已投递</span></li>
                <li class="side-interview"><a href="javascript:;" ka="side_interview"></a><span
                        class="side-popper">面试</span></li>
                <li class="side-service"><a href="javascript:;"></a><span class="side-popper">客服</span></li>
                <li class="side-other"><a href="javascript:;"></a>
                    <ul class="other-list">
                        <li><a href="javascript:;" class="siderbar-app">APP <div class="qrcode-layer"><i></i><img
                                        src="/wflow/zpgeek/qrcode/generate.json?content=https%3A%2F%2Fwww.zhipin.com%2Fwapi%2FzpCommon%2Fdownload%2Findex%3Ftype%3Dqr%26pkn%3Dmain-m%26sid%3Dmoren_14&amp;w=200&amp;h=200"
                                        alt="">下载BOSS直聘APP </div></a></li>
                        <li><a href="javascript:;" class="siderbar-wechat">微信 <div class="qrcode-layer"><i></i><img
                                        src="https://static.zhipin.com/v2/web/geek/images/wechat-qrcode-2.jpg"
                                        alt="">关注BOSS直聘微信服务号</div></a></li>
                        <li><a href="https://weibo.com/bosszhipin" target="_blank" class="siderbar">微博</a></li>
                    </ul>
                </li>
            </ul>
        </div> -->
    <!-- </div> -->
</div>
<script src="/dev/plugins/jquery/jquery.min.js"></script>
<script src="/dev/plugins/layui/layui/layui.js"></script>
<script src="/dev/plugins/bootstrap/js/bootstrap.js"></script>
<script>

    $(function () {
        $("#nav").load("/dev/views/common/nav.html")
        let cont = document.querySelector(".content")
        $.ajax({
            headers: {
                "id": localStorage.getItem("id"),
                "token": localStorage.getItem("token")
            },
            url: "/dev/collect/num",
            type: "post",
            data: {"jsId": localStorage.getItem("id")},
            success: function (result) {
                if (result.code == 200) {
                    let user = document.querySelector(".user-stat")
                    user.children[0].innerHTML = `<b data-v-7d3f5d0c="">${result.data.addNum}</b>沟通过`
                    user.children[1].innerHTML = `<b data-v-7d3f5d0c="">${result.data.submitNum}</b>已投递`
                    user.children[2].innerHTML = `<b data-v-7d3f5d0c="">${result.data.interviewNum}</b>面试`
                    user.children[3].innerHTML = `<b data-v-7d3f5d0c="">${result.data.interestNum}</b>感兴趣`
                }
            }
        })
        $.ajax({
            headers: {
                "id": localStorage.getItem("id"),
                "token": localStorage.getItem("token")
            },
            url: '/dev/collect/userInfo',
            type: 'post',
            data: {
                // "jsId": localStorage.getItem("userId")
                "jsId": localStorage.getItem("id")
            },
            success: function (result) {
                if (result.code == 200) {
                    console.log(result)
                    cont.innerHTML = `<div data-v-7d3f5d0c="" class="username"><span data-v-7d3f5d0c=""
                                                               class="username">${result.data.jsName}</span></div>
                <div data-v-7d3f5d0c="" class="userinfo"> ${result.data.age}
                </div>
              </div>`
                }
            }
        })
        var params = new URLSearchParams(window.location.search);
        var page = params.get('page');
        console.log(page)

        if (page == 4) {
            let interest = document.querySelector("[ka=\"personal_top_interest\"]")
            interest.className = 'current'
            let content = document.querySelector(".chat-history-box-wrap")
            layui.use(['laypage', 'layer'], function () {
                    var laypage = layui.laypage
                        , layer = layui.layer;
                    var currentPage = 1; // 当前页码
                    var pageSize = 4;
                    $.ajax({
                        headers: {
                            "id": localStorage.getItem("id"),
                            "token": localStorage.getItem("token")
                        },
                        url: '/dev/collect/total',
                        type: "post",
                        data: {
                            "jsId": localStorage.getItem("id")
                        },
                        success: function (result) {
                            console.log(result)

                            function initPagination() {
                                laypage.render({
                                    elem: 'options-pages',
                                    count: result.data,
                                    limit: pageSize,
                                    limits: [4, 6, 8, 10],
                                    curr: currentPage,
                                    layout: ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip'],
                                    jump: function (obj, first) {
                                        console.log(obj)
                                        if (!first) {
                                            currentPage = obj.curr;
                                            pageSize = obj.limit
                                            loadData()
                                        }
                                    }
                                });
                            }

                            function loadData() {
                                $.ajax({
                                    headers: {
                                        "id": localStorage.getItem("id"),
                                        "token": localStorage.getItem("token")
                                    },
                                    url: '/dev/collect/jobfromchat',  // 后端接口地址
                                    type: 'post',
                                    data: {
                                        // "jsId":localStorage.getItem("userId")
                                        "page": currentPage,
                                        "limit": pageSize,
                                        "jsId": localStorage.getItem("id")
                                    },
                                    success: function (result) {
                                        console.log(result)
                                        if (result.code == 200) {
                                            var data = result.data;
                                            // 渲染数据列表
                                            renderData(data);
                                            // 初始化分页
                                            initPagination();
                                        } else {
                                            layer.msg('数据加载失败');
                                        }
                                    },
                                    error: function () {
                                        layer.msg('请求失败');
                                    }
                                });
                            }

                            function renderData(data) {
                                let str = `<ul data-v-e2a11294="" class="user-jobs-ul">`;
                                for (let i = 0; i < data.list.length; i++) {
                                    str += `    <li data-v-e2a11294="" class="item-boss">
      <div data-v-e2a11294="" class="item-content">
        <div data-v-e2a11294="" class="info-header"><!---->
          <div data-v-e2a11294="" class="btns"><!----><a data-v-e2a11294="" href="javascript:;"
                                                         ka="personal_interest_continue_7c87cffde6b7e1411nR83Ny4EFpS"
                                                         class="btn btn-startchat">继续沟通</a><!----><a data-v-e2a11294="" href="javascript:;"
                                                                                                         ka="personal_interest_cancel_7c87cffde6b7e1411nR83Ny4EFpS"
                                                                                                         class="btn btn-like">取消感兴趣</a><!----></div>
          <div data-v-e2a11294="" class="img-box"><img data-v-e2a11294=""
                                                       src="${data.list[i].jrAvatar}">
            <h3 data-v-e2a11294="" class="name"> ${data.list[i].contactPerson}<em data-v-e2a11294="" class="vline"></em>高级经理<!---->
            </h3>
          </div>
        </div>
        <div data-v-e2a11294="" class="info-primary flex-reverse info-primary-noninterview">
          <div data-v-e2a11294="" class="company-info"><img data-v-e2a11294=""
                                                            src="${data.list[i].jrAvatar}">
            <div data-v-e2a11294="" class="text"><b data-v-e2a11294=""><a data-v-e2a11294=""
                                                                          href="/dev/views/job/page/jobdetails.html?jrId=${data.list[i].id}"
                                                                          ka="personal_interest_brand_4e688f26febb7b191HVy29W7">${data.list[i].companyName}</a></b>
              <p data-v-e2a11294="" class="gray"><span data-v-e2a11294="">${data.list[i].companyType}</span><span
                      data-v-e2a11294="">A轮</span><span data-v-e2a11294="">${data.list[i].recruitsNum}</span></p>
            </div>
          </div>
          <div data-v-e2a11294="" class="job-info width-500">
            <div data-v-e2a11294="" class="job-name">
              <div data-v-e2a11294="" class="flex"><a data-v-e2a11294=""
                                                      href="/dev/views/job/page/jobdetails.html?postId=${data.list[i].posId}"
                                                      class="name"><span data-v-e2a11294="">${data.list[i].posName}</span><span data-v-e2a11294=""
                                                                                                                           class="location">[${data.list[i].workPlace}]</span></a></div>
            </div>
            <p data-v-e2a11294="" class="gray"> ${data.list[i].pay} <span data-v-e2a11294=""> ${data.list[i].expDemand} </span> <span
                    data-v-e2a11294="">${data.list[i].background}</span></p>
          </div>
        </div>
      </div>
    </li>`
                                }
                                str += `</ul>`
                                let childElements = content.children
                                childElements[1].outerHTML = str;
                            }

                            // 初始化加载数据
                            loadData();
                        }
                    })
                }
            )
        } else if (page == 1) {
            let interest = document.querySelector("[ka=\"personal_top_added\"]")
            interest.className = 'current'
            let content = document.querySelector(".chat-history-box-wrap")
            layui.use(['laypage', 'layer'], function () {
                    var laypage = layui.laypage
                        , layer = layui.layer;
                    var currentPage = 1; // 当前页码
                    var pageSize = 4;
                    $.ajax({
                        headers: {
                            "id": localStorage.getItem("id"),
                            "token": localStorage.getItem("token")
                        },
                        url: '/dev/collect/addedTotal',
                        type: "post",
                        data: {
                            "jsId": localStorage.getItem("id")
                        },
                        success: function (result) {
                            console.log(result)

                            function initPagination() {
                                laypage.render({
                                    elem: 'options-pages',
                                    count: result.data,
                                    limit: pageSize,
                                    limits: [4, 6, 8, 10],
                                    curr: currentPage,
                                    layout: ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip'],
                                    jump: function (obj, first) {
                                        console.log(obj)
                                        if (!first) {
                                            currentPage = obj.curr;
                                            pageSize = obj.limit
                                            loadData()
                                        }
                                    }
                                });
                            }

                            function loadData() {
                                $.ajax({
                                    headers: {
                                        "id": localStorage.getItem("id"),
                                        "token": localStorage.getItem("token")
                                    },
                                    url: '/dev/collect/added',  // 后端接口地址
                                    type: 'post',
                                    data: {
                                        // "jsId":localStorage.getItem("userId")
                                        "page": currentPage,
                                        "limit": pageSize,
                                        "jsId": localStorage.getItem("id")
                                    },
                                    success: function (result) {
                                        console.log(result)
                                        if (result.code == 200) {
                                            var data = result.data;
                                            // 渲染数据列表
                                            renderData(data);
                                            // 初始化分页
                                            initPagination();
                                        } else {
                                            layer.msg('数据加载失败');
                                        }
                                    },
                                    error: function () {
                                        layer.msg('请求失败');
                                    }
                                });
                            }

                            function renderData(data) {
                                let str = `<ul data-v-e2a11294="" class="user-jobs-ul">`;
                                for (let i = 0; i < data.list.length; i++) {
                                    str += `    <li data-v-e2a11294="" class="item-boss">
      <div data-v-e2a11294="" class="item-content">
        <div data-v-e2a11294="" class="info-header"><!---->
          <div data-v-e2a11294="" class="btns"><!----><a data-v-e2a11294="" href="javascript:;"
                                                         ka="personal_interest_continue_7c87cffde6b7e1411nR83Ny4EFpS"
                                                         class="btn btn-startchat">继续沟通</a><!----><a data-v-e2a11294="" href="javascript:;"
                                                                                                         ka="personal_interest_cancel_7c87cffde6b7e1411nR83Ny4EFpS"
                                                                                                         class="btn btn-like">取消感兴趣</a><!----></div>
          <div data-v-e2a11294="" class="img-box"><img data-v-e2a11294=""
                                                       src="${data.list[i].jrAvatar}">
            <h3 data-v-e2a11294="" class="name"> ${data.list[i].contactPerson}<em data-v-e2a11294="" class="vline"></em>高级经理<!---->
            </h3>
          </div>
        </div>
        <div data-v-e2a11294="" class="info-primary flex-reverse info-primary-noninterview">
          <div data-v-e2a11294="" class="company-info"><img data-v-e2a11294=""
                                                            src="${data.list[i].jrAvatar}">
            <div data-v-e2a11294="" class="text"><b data-v-e2a11294=""><a data-v-e2a11294=""
                                                                          href="/dev/views/job/page/jobdetails.html?jrId=${data.list[i].jrId}"
                                                                          ka="personal_interest_brand_4e688f26febb7b191HVy29W7">${data.list[i].companyName}</a></b>
              <p data-v-e2a11294="" class="gray"><span data-v-e2a11294="">${data.list[i].companyType}</span><span
                      data-v-e2a11294="">A轮</span><span data-v-e2a11294="">${data.list[i].recruitsNum}</span></p>
            </div>
          </div>
          <div data-v-e2a11294="" class="job-info width-500">
            <div data-v-e2a11294="" class="job-name">
              <div data-v-e2a11294="" class="flex"><a data-v-e2a11294=""
                                                      href="/dev/views/job/page/jobdetails.html?posId=${data.list[i].posId}"
                                                      class="name"><span data-v-e2a11294="">${data.list[i].posName}</span><span data-v-e2a11294=""
                                                                                                                           class="location">[${data.list[i].workPlace}]</span></a></div>
            </div>
            <p data-v-e2a11294="" class="gray"> ${data.list[i].pay} <span data-v-e2a11294=""> ${data.list[i].expDemand} </span> <span
                    data-v-e2a11294="">${data.list[i].background}</span></p>
          </div>
        </div>
      </div>
    </li>`
                                }
                                str += `</ul>`
                                let childElements = content.children
                                childElements[1].outerHTML = str;
                            }

                            // 初始化加载数据
                            loadData();
                        }
                    })
                }
            )
        } else if (page == 2) {
            let interest = document.querySelector("[ka=\"personal_top_submitted\"]")
            interest.className = 'current'
            let content = document.querySelector(".chat-history-box-wrap")
            layui.use(['laypage', 'layer'], function () {
                    var laypage = layui.laypage
                        , layer = layui.layer;
                    var currentPage = 1; // 当前页码
                    var pageSize = 4;
                    $.ajax({
                        headers: {
                            "id": localStorage.getItem("id"),
                            "token": localStorage.getItem("token")
                        },
                        url: '/dev/collect/submitTotal',  // 后端接口地址
                        type: 'post',
                        data: {
                            "jsId": localStorage.getItem("id")
                        },
                        success: function (result) {
                            console.log(result)

                            function initPagination() {
                                laypage.render({
                                    elem: 'options-pages',
                                    count: result.data,
                                    limit: pageSize,
                                    limits: [4, 6, 8, 10],
                                    curr: currentPage,
                                    layout: ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip'],
                                    jump: function (obj, first) {
                                        console.log(obj)
                                        if (!first) {
                                            currentPage = obj.curr;
                                            pageSize = obj.limit
                                            loadData()
                                        }
                                    }
                                });
                            }

                            function loadData() {
                                $.ajax({
                                    headers: {
                                        "id": localStorage.getItem("id"),
                                        "token": localStorage.getItem("token")
                                    },
                                    url: '/dev/collect/submit',  // 后端接口地址
                                    type: 'post',
                                    data: {
                                        // "jsId":localStorage.getItem("userId")
                                        "page": currentPage,
                                        "limit": pageSize,
                                        "jsId": localStorage.getItem("id")
                                    },
                                    success: function (result) {
                                        console.log(result)
                                        if (result.code == 200) {
                                            var data = result.data;
                                            // 渲染数据列表
                                            renderData(data);
                                            // 初始化分页
                                            initPagination();
                                        } else {
                                            layer.msg('数据加载失败');
                                        }
                                    },
                                    error: function () {
                                        layer.msg('请求失败');
                                    }
                                });
                            }

                            function renderData(data) {
                                let str = `<ul data-v-e2a11294="" class="user-jobs-ul">`;
                                for (let i = 0; i < data.list.length; i++) {
                                    str += `    <li data-v-e2a11294="" class="item-boss">
      <div data-v-e2a11294="" class="item-content">
        <div data-v-e2a11294="" class="info-header"><!---->
          <div data-v-e2a11294="" class="btns"><!----><a data-v-e2a11294="" href="javascript:;"
                                                         ka="personal_interest_continue_7c87cffde6b7e1411nR83Ny4EFpS"
                                                         class="btn btn-startchat">继续沟通</a><!----><a data-v-e2a11294="" href="javascript:;"
                                                                                                         ka="personal_interest_cancel_7c87cffde6b7e1411nR83Ny4EFpS"
                                                                                                         class="btn btn-like">取消感兴趣</a><!----></div>
          <div data-v-e2a11294="" class="img-box"><img data-v-e2a11294=""
                                                       src="${data.list[i].jrAvatar}">
            <h3 data-v-e2a11294="" class="name"> ${data.list[i].contactPerson}<em data-v-e2a11294="" class="vline"></em>高级经理<!---->
            </h3>
          </div>
        </div>
        <div data-v-e2a11294="" class="info-primary flex-reverse info-primary-noninterview">
          <div data-v-e2a11294="" class="company-info"><img data-v-e2a11294=""
                                                            src="${data.list[i].jrAvatar}">
            <div data-v-e2a11294="" class="text"><b data-v-e2a11294=""><a data-v-e2a11294=""
                                                                          href="/dev/views/job/page/jobdetails.html?jrId=${data.list[i].jrId}"
                                                                          ka="personal_interest_brand_4e688f26febb7b191HVy29W7">${data.list[i].companyName}</a></b>
              <p data-v-e2a11294="" class="gray"><span data-v-e2a11294="">${data.list[i].companyType}</span><span
                      data-v-e2a11294="">A轮</span><span data-v-e2a11294="">${data.list[i].recruitsNum}</span></p>
            </div>
          </div>
          <div data-v-e2a11294="" class="job-info width-500">
            <div data-v-e2a11294="" class="job-name">
              <div data-v-e2a11294="" class="flex"><a data-v-e2a11294=""
                                                      href="/dev/views/job/page/jobdetails.html?posId=${data.list[i].posId}"
                                                      class="name"><span data-v-e2a11294="">${data.list[i].posName}</span><span data-v-e2a11294=""
                                                                                                                           class="location">[${data.list[i].workPlace}]</span></a></div>
            </div>
            <p data-v-e2a11294="" class="gray"> ${data.list[i].pay} <span data-v-e2a11294=""> ${data.list[i].expDemand} </span> <span
                    data-v-e2a11294="">${data.list[i].background}</span></p>
          </div>
        </div>
      </div>
    </li>`
                                }
                                str += `</ul>`
                                let childElements = content.children
                                childElements[1].outerHTML = str;
                            }

                            // 初始化加载数据
                            loadData();
                        }
                    })
                }
            )
        } else if (page == 3) {
            let interest = document.querySelector("[ka=\"personal_top_interview\"]")
            interest.className = 'current'
            let content = document.querySelector(".chat-history-box-wrap")
            layui.use(['laypage', 'layer'], function () {
                    var laypage = layui.laypage
                        , layer = layui.layer;
                    var currentPage = 1; // 当前页码
                    var pageSize = 4;
                    $.ajax({
                        headers: {
                            "id": localStorage.getItem("id"),
                            "token": localStorage.getItem("token")
                        },
                        url: '/dev/collect/interviewTotal',
                        type: "post",
                        data: {
                            "jsId": localStorage.getItem("id")
                        },
                        success: function (result) {
                            console.log(result)

                            function initPagination() {
                                laypage.render({
                                    elem: 'options-pages',
                                    count: result.data,
                                    limit: pageSize,
                                    limits: [4, 6, 8, 10],
                                    curr: currentPage,
                                    layout: ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip'],
                                    jump: function (obj, first) {
                                        console.log(obj)
                                        if (!first) {
                                            currentPage = obj.curr;
                                            pageSize = obj.limit
                                            loadData()
                                        }
                                    }
                                });
                            }

                            function loadData() {
                                $.ajax({
                                    headers: {
                                        "id": localStorage.getItem("id"),
                                        "token": localStorage.getItem("token")
                                    },
                                    url: '/dev/collect/interview',  // 后端接口地址
                                    type: 'post',
                                    data: {
                                        // "jsId":localStorage.getItem("userId")
                                        "page": currentPage,
                                        "limit": pageSize,
                                        "jsId": localStorage.getItem("id")
                                    },
                                    success: function (result) {
                                        console.log(result)
                                        if (result.code == 200) {
                                            var data = result.data;
                                            // 渲染数据列表
                                            renderData(data);
                                            // 初始化分页
                                            initPagination();
                                        } else {
                                            layer.msg('数据加载失败');
                                        }
                                    },
                                    error: function () {
                                        layer.msg('请求失败');
                                    }
                                });
                            }

                            function renderData(data) {
                                let str = `<ul data-v-e2a11294="" class="user-jobs-ul">`;
                                for (let i = 0; i < data.list.length; i++) {
                                    str += `    <li data-v-e2a11294="" class="item-boss">
      <div data-v-e2a11294="" class="item-content">
        <div data-v-e2a11294="" class="info-header"><!---->
          <div data-v-e2a11294="" class="btns"><!----><a data-v-e2a11294="" href="javascript:;"
                                                         ka="personal_interest_continue_7c87cffde6b7e1411nR83Ny4EFpS"
                                                         class="btn btn-startchat">继续沟通</a><!----><a data-v-e2a11294="" href="javascript:;"
                                                                                                         ka="personal_interest_cancel_7c87cffde6b7e1411nR83Ny4EFpS"
                                                                                                         class="btn btn-like">取消感兴趣</a><!----></div>
          <div data-v-e2a11294="" class="img-box"><img data-v-e2a11294=""
                                                       src="${data.list[i].jrAvatar}">
            <h3 data-v-e2a11294="" class="name"> ${data.list[i].contactPerson}<em data-v-e2a11294="" class="vline"></em>高级经理<!---->
            </h3>
          </div>
        </div>
        <div data-v-e2a11294="" class="info-primary flex-reverse info-primary-noninterview">
          <div data-v-e2a11294="" class="company-info"><img data-v-e2a11294=""
                                                            src="${data.list[i].jrAvatar}">
            <div data-v-e2a11294="" class="text"><b data-v-e2a11294=""><a data-v-e2a11294=""
                                                                          href="/dev/views/job/page/jobdetails.html?jrId=${data.list[i].jrId}"
                                                                          ka="personal_interest_brand_4e688f26febb7b191HVy29W7">${data.list[i].companyName}</a></b>
              <p data-v-e2a11294="" class="gray"><span data-v-e2a11294="">${data.list[i].companyType}</span><span
                      data-v-e2a11294="">A轮</span><span data-v-e2a11294="">${data.list[i].recruitsNum}</span></p>
            </div>
          </div>
          <div data-v-e2a11294="" class="job-info width-500">
            <div data-v-e2a11294="" class="job-name">
              <div data-v-e2a11294="" class="flex"><a data-v-e2a11294=""
                                                      href="/dev/views/job/page/boss.html?posId=${data.list[i].posId}"
                                                      class="name"><span data-v-e2a11294="">${data.list[i].posName}</span><span data-v-e2a11294=""
                                                                                                                           class="location">[${data.list[i].workPlace}]</span></a></div>
            </div>
            <p data-v-e2a11294="" class="gray"> ${data.list[i].pay} <span data-v-e2a11294=""> ${data.list[i].expDemand} </span> <span
                    data-v-e2a11294="">${data.list[i].background}</span></p>
          </div>
        </div>
      </div>
    </li>`
                                }
                                str += `</ul>`
                                let childElements = content.children
                                childElements[1].outerHTML = str;
                            }

                            // 初始化加载数据
                            loadData();
                        }
                    })
                }
            )
        }
    })

    let added = document.querySelector("[ka=\"personal_top_added\"]")
    let submitted = document.querySelector("[ka=\"personal_top_submitted\"]")
    let interview = document.querySelector("[ka=\"personal_top_interview\"]")
    let interest = document.querySelector("[ka=\"personal_top_interest\"]")
    interest.addEventListener('click', function () {
        added.className = ''
        submitted.className = ''
        interview.className = ''
        interest.className = 'current'
        let content = document.querySelector(".chat-history-box-wrap")
        layui.use(['laypage', 'layer'], function () {
                var laypage = layui.laypage
                    , layer = layui.layer;
                var currentPage = 1; // 当前页码
                var pageSize = 4;
                $.ajax({
                    headers: {
                        "id": localStorage.getItem("id"),
                        "token": localStorage.getItem("token")
                    },
                    url: '/dev/collect/total',
                    type: "post",
                    data: {
                        "jsId": localStorage.getItem("id")
                    },
                    success: function (result) {
                        console.log(result)

                        function initPagination() {
                            laypage.render({
                                elem: 'options-pages',
                                count: result.data,
                                limit: pageSize,
                                limits: [4, 6, 8, 10],
                                curr: currentPage,
                                layout: ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip'],
                                jump: function (obj, first) {
                                    console.log(obj)
                                    if (!first) {
                                        currentPage = obj.curr;
                                        pageSize = obj.limit
                                        loadData()
                                    }
                                }
                            });
                        }

                        function loadData() {
                            $.ajax({
                                headers: {
                                    "id": localStorage.getItem("id"),
                                    "token": localStorage.getItem("token")
                                },
                                url: '/dev/collect/jobfromchat',  // 后端接口地址
                                type: 'post',
                                data: {
                                    // "jsId":localStorage.getItem("userId")
                                    "page": currentPage,
                                    "limit": pageSize,
                                    "jsId": localStorage.getItem("id")
                                },
                                success: function (result) {
                                    console.log(result)
                                    if (result.code == 200) {
                                        var data = result.data;
                                        // 渲染数据列表
                                        renderData(data);
                                        // 初始化分页
                                        initPagination();
                                    } else {
                                        layer.msg('数据加载失败');
                                    }
                                },
                                error: function () {
                                    layer.msg('请求失败');
                                }
                            });
                        }

                        function renderData(data) {
                            let str = `<ul data-v-e2a11294="" class="user-jobs-ul">`;
                            for (let i = 0; i < data.list.length; i++) {
                                str += `    <li data-v-e2a11294="" class="item-boss">
      <div data-v-e2a11294="" class="item-content">
        <div data-v-e2a11294="" class="info-header"><!---->
          <div data-v-e2a11294="" class="btns"><!----><a data-v-e2a11294="" href="javascript:;"
                                                         ka="personal_interest_continue_7c87cffde6b7e1411nR83Ny4EFpS"
                                                         class="btn btn-startchat">继续沟通</a><!----><a data-v-e2a11294="" href="javascript:;"
                                                                                                         ka="personal_interest_cancel_7c87cffde6b7e1411nR83Ny4EFpS"
                                                                                                         class="btn btn-like">取消感兴趣</a><!----></div>
          <div data-v-e2a11294="" class="img-box"><img data-v-e2a11294=""
                                                       src="${data.list[i].jrAvatar}">
            <h3 data-v-e2a11294="" class="name"> ${data.list[i].contactPerson}<em data-v-e2a11294="" class="vline"></em>高级经理<!---->
            </h3>
          </div>
        </div>
        <div data-v-e2a11294="" class="info-primary flex-reverse info-primary-noninterview">
          <div data-v-e2a11294="" class="company-info"><img data-v-e2a11294=""
                                                            src="${data.list[i].jrAvatar}">
            <div data-v-e2a11294="" class="text"><b data-v-e2a11294=""><a data-v-e2a11294=""
                                                                          href="/dev/views/job/page/jobdetails.html?jrId=${data.list[i].jrId}"
                                                                          ka="personal_interest_brand_4e688f26febb7b191HVy29W7">${data.list[i].companyName}</a></b>
              <p data-v-e2a11294="" class="gray"><span data-v-e2a11294="">${data.list[i].companyType}</span><span
                      data-v-e2a11294="">A轮</span><span data-v-e2a11294="">${data.list[i].recruitsNum}</span></p>
            </div>
          </div>
          <div data-v-e2a11294="" class="job-info width-500">
            <div data-v-e2a11294="" class="job-name">
              <div data-v-e2a11294="" class="flex"><a data-v-e2a11294=""
                                                      href="/dev/views/job/page/boss.html?posId=${data.list[i].posId}"
                                                      class="name"><span data-v-e2a11294="">${data.list[i].posName}</span><span data-v-e2a11294=""
                                                                                                                           class="location">[${data.list[i].workPlace}]</span></a></div>
            </div>
            <p data-v-e2a11294="" class="gray"> ${data.list[i].pay} <span data-v-e2a11294=""> ${data.list[i].expDemand} </span> <span
                    data-v-e2a11294="">${data.list[i].background}</span></p>
          </div>
        </div>
      </div>
    </li>`
                            }
                            str += `</ul>`
                            let childElements = content.children
                            childElements[1].outerHTML = str;
                        }

                        // 初始化加载数据
                        loadData();
                    }
                })
            }
        )
    })

    added.addEventListener('click', function () {
        added.className = 'current'
        submitted.className = ''
        interview.className = ''
        interest.className = ''
        let content = document.querySelector(".chat-history-box-wrap")
        layui.use(['laypage', 'layer'], function () {
                var laypage = layui.laypage
                    , layer = layui.layer;
                var currentPage = 1; // 当前页码
                var pageSize = 4;
                $.ajax({
                    headers: {
                        "id": localStorage.getItem("id"),
                        "token": localStorage.getItem("token")
                    },
                    url: '/dev/collect/addedTotal',
                    type: "post",
                    data: {
                        "jsId": localStorage.getItem("id")
                    },
                    success: function (result) {
                        console.log(result)

                        function initPagination() {
                            laypage.render({
                                elem: 'options-pages',
                                count: result.data,
                                limit: pageSize,
                                limits: [4, 6, 8, 10],
                                curr: currentPage,
                                layout: ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip'],
                                jump: function (obj, first) {
                                    console.log(obj)
                                    if (!first) {
                                        currentPage = obj.curr;
                                        pageSize = obj.limit
                                        loadData()
                                    }
                                }
                            });
                        }

                        function loadData() {
                            $.ajax({
                                headers: {
                                    "id": localStorage.getItem("id"),
                                    "token": localStorage.getItem("token")
                                },
                                url: '/dev/collect/added',  // 后端接口地址
                                type: 'post',
                                data: {
                                    // "jsId":localStorage.getItem("userId")
                                    "page": currentPage,
                                    "limit": pageSize,
                                    "jsId": localStorage.getItem("id")
                                },
                                success: function (result) {
                                    console.log(result)
                                    if (result.code == 200) {
                                        var data = result.data;
                                        // 渲染数据列表
                                        renderData(data);
                                        // 初始化分页
                                        initPagination();
                                    } else {
                                        layer.msg('数据加载失败');
                                    }
                                },
                                error: function () {
                                    layer.msg('请求失败');
                                }
                            });
                        }

                        function renderData(data) {
                            let str = `<ul data-v-e2a11294="" class="user-jobs-ul">`;
                            for (let i = 0; i < data.list.length; i++) {
                                str += `    <li data-v-e2a11294="" class="item-boss">
      <div data-v-e2a11294="" class="item-content">
        <div data-v-e2a11294="" class="info-header"><!---->
          <div data-v-e2a11294="" class="btns"><!----><a data-v-e2a11294="" href="javascript:;"
                                                         ka="personal_interest_continue_7c87cffde6b7e1411nR83Ny4EFpS"
                                                         class="btn btn-startchat">继续沟通</a><!----><a data-v-e2a11294="" href="javascript:;"
                                                                                                         ka="personal_interest_cancel_7c87cffde6b7e1411nR83Ny4EFpS"
                                                                                                         class="btn btn-like">取消感兴趣</a><!----></div>
          <div data-v-e2a11294="" class="img-box"><img data-v-e2a11294=""
                                                       src="${data.list[i].jrAvatar}">
            <h3 data-v-e2a11294="" class="name"> ${data.list[i].contactPerson}<em data-v-e2a11294="" class="vline"></em>高级经理<!---->
            </h3>
          </div>
        </div>
        <div data-v-e2a11294="" class="info-primary flex-reverse info-primary-noninterview">
          <div data-v-e2a11294="" class="company-info"><img data-v-e2a11294=""
                                                            src="${data.list[i].jrAvatar}">
            <div data-v-e2a11294="" class="text"><b data-v-e2a11294=""><a data-v-e2a11294=""
                                                                          href="/dev/views/job/page/jobdetails.html?jrId=${data.list[i].jrId}"
                                                                          ka="personal_interest_brand_4e688f26febb7b191HVy29W7">${data.list[i].companyName}</a></b>
              <p data-v-e2a11294="" class="gray"><span data-v-e2a11294="">${data.list[i].companyType}</span><span
                      data-v-e2a11294="">A轮</span><span data-v-e2a11294="">${data.list[i].recruitsNum}</span></p>
            </div>
          </div>
          <div data-v-e2a11294="" class="job-info width-500">
            <div data-v-e2a11294="" class="job-name">
              <div data-v-e2a11294="" class="flex"><a data-v-e2a11294=""
                                                      href="/dev/views/job/page/boss.html?posId=${data.list[i].posId}"
                                                      class="name"><span data-v-e2a11294="">${data.list[i].posName}</span><span data-v-e2a11294=""
                                                                                                                           class="location">[${data.list[i].workPlace}]</span></a></div>
            </div>
            <p data-v-e2a11294="" class="gray"> ${data.list[i].pay} <span data-v-e2a11294=""> ${data.list[i].expDemand} </span> <span
                    data-v-e2a11294="">${data.list[i].background}</span></p>
          </div>
        </div>
      </div>
    </li>`
                            }
                            str += `</ul>`
                            let childElements = content.children
                            childElements[1].outerHTML = str;
                        }

                        // 初始化加载数据
                        loadData();
                    }
                })
            }
        )
    })
    submitted.addEventListener('click', function () {
        interview.className = ''
        interest.className = ''
        added.className = ''
        submitted.className = 'current'
        let content = document.querySelector(".chat-history-box-wrap")
        layui.use(['laypage', 'layer'], function () {
                var laypage = layui.laypage
                    , layer = layui.layer;
                var currentPage = 1; // 当前页码
                var pageSize = 4;
                $.ajax({
                    headers: {
                        "id": localStorage.getItem("id"),
                        "token": localStorage.getItem("token")
                    },
                    url: '/dev/collect/submitTotal',
                    type: "post",
                    data: {
                        "jsId": localStorage.getItem("id")
                    },
                    success: function (result) {
                        console.log(result)

                        function initPagination() {
                            laypage.render({
                                elem: 'options-pages',
                                count: result.data,
                                limit: pageSize,
                                limits: [4, 6, 8, 10],
                                curr: currentPage,
                                layout: ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip'],
                                jump: function (obj, first) {
                                    console.log(obj)
                                    if (!first) {
                                        currentPage = obj.curr;
                                        pageSize = obj.limit
                                        loadData()
                                    }
                                }
                            });
                        }

                        function loadData() {
                            $.ajax({
                                headers: {
                                    "id": localStorage.getItem("id"),
                                    "token": localStorage.getItem("token")
                                },
                                url: '/dev/collect/submit',  // 后端接口地址
                                type: 'post',
                                data: {
                                    // "jsId":localStorage.getItem("userId")
                                    "page": currentPage,
                                    "limit": pageSize,
                                    "jsId": localStorage.getItem("id")
                                },
                                success: function (result) {
                                    console.log(result)
                                    if (result.code == 200) {
                                        var data = result.data;
                                        // 渲染数据列表
                                        renderData(data);
                                        // 初始化分页
                                        initPagination();
                                    } else {
                                        layer.msg('数据加载失败');
                                    }
                                },
                                error: function () {
                                    layer.msg('请求失败');
                                }
                            });
                        }

                        function renderData(data) {
                            let str = `<ul data-v-e2a11294="" class="user-jobs-ul">`;
                            for (let i = 0; i < data.list.length; i++) {
                                str += `    <li data-v-e2a11294="" class="item-boss">
      <div data-v-e2a11294="" class="item-content">
        <div data-v-e2a11294="" class="info-header"><!---->
          <div data-v-e2a11294="" class="btns"><!----><a data-v-e2a11294="" href="javascript:;"
                                                         ka="personal_interest_continue_7c87cffde6b7e1411nR83Ny4EFpS"
                                                         class="btn btn-startchat">继续沟通</a><!----><a data-v-e2a11294="" href="javascript:;"
                                                                                                         ka="personal_interest_cancel_7c87cffde6b7e1411nR83Ny4EFpS"
                                                                                                         class="btn btn-like">取消感兴趣</a><!----></div>
          <div data-v-e2a11294="" class="img-box"><img data-v-e2a11294=""
                                                       src="${data.list[i].jrAvatar}">
            <h3 data-v-e2a11294="" class="name"> ${data.list[i].contactPerson}<em data-v-e2a11294="" class="vline"></em>高级经理<!---->
            </h3>
          </div>
        </div>
        <div data-v-e2a11294="" class="info-primary flex-reverse info-primary-noninterview">
          <div data-v-e2a11294="" class="company-info"><img data-v-e2a11294=""
                                                            src="${data.list[i].jrAvatar}">
            <div data-v-e2a11294="" class="text"><b data-v-e2a11294=""><a data-v-e2a11294=""
                                                                          href="/dev/views/job/page/jobdetails.html?jrId=${data.list[i].jrId}"
                                                                          ka="personal_interest_brand_4e688f26febb7b191HVy29W7">${data.list[i].companyName}</a></b>
              <p data-v-e2a11294="" class="gray"><span data-v-e2a11294="">${data.list[i].companyType}</span><span
                      data-v-e2a11294="">A轮</span><span data-v-e2a11294="">${data.list[i].recruitsNum}</span></p>
            </div>
          </div>
          <div data-v-e2a11294="" class="job-info width-500">
            <div data-v-e2a11294="" class="job-name">
              <div data-v-e2a11294="" class="flex"><a data-v-e2a11294=""
                                                      href="/dev/views/job/page/boss.html?posId=${data.list[i].posId}"
                                                      class="name"><span data-v-e2a11294="">${data.list[i].posName}</span><span data-v-e2a11294=""
                                                                                                                           class="location">[${data.list[i].workPlace}]</span></a></div>
            </div>
            <p data-v-e2a11294="" class="gray"> ${data.list[i].pay} <span data-v-e2a11294=""> ${data.list[i].expDemand} </span> <span
                    data-v-e2a11294="">${data.list[i].background}</span></p>
          </div>
        </div>
      </div>
    </li>`
                            }
                            str += `</ul>`
                            let childElements = content.children
                            childElements[1].outerHTML = str;
                        }

                        // 初始化加载数据
                        loadData();
                    }
                })
            }
        )
    })
    interview.addEventListener('click', function () {
        interest.className = ''
        added.className = ''
        submitted.className = ''
        interview.className = 'current'
        let content = document.querySelector(".chat-history-box-wrap")
        layui.use(['laypage', 'layer'], function () {
                var laypage = layui.laypage
                    , layer = layui.layer;
                var currentPage = 1; // 当前页码
                var pageSize = 4;
                $.ajax({
                    headers: {
                        "id": localStorage.getItem("id"),
                        "token": localStorage.getItem("token")
                    },
                    url: '/dev/collect/interviewTotal',
                    type: "post",
                    data: {
                        "jsId": localStorage.getItem("id")
                    },
                    success: function (result) {
                        console.log(result)

                        function initPagination() {
                            laypage.render({
                                elem: 'options-pages',
                                count: result.data,
                                limit: pageSize,
                                limits: [4, 6, 8, 10],
                                curr: currentPage,
                                layout: ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip'],
                                jump: function (obj, first) {
                                    console.log(obj)
                                    if (!first) {
                                        currentPage = obj.curr;
                                        pageSize = obj.limit
                                        loadData()
                                    }
                                }
                            });
                        }

                        function loadData() {
                            $.ajax({
                                headers: {
                                    "id": localStorage.getItem("id"),
                                    "token": localStorage.getItem("token")
                                },
                                url: '/dev/collect/interview',  // 后端接口地址
                                type: 'post',
                                data: {
                                    // "jsId":localStorage.getItem("userId")
                                    "page": currentPage,
                                    "limit": pageSize,
                                    "jsId": localStorage.getItem("id")
                                },
                                success: function (result) {
                                    console.log(result)
                                    if (result.code == 200) {
                                        var data = result.data;
                                        // 渲染数据列表
                                        renderData(data);
                                        // 初始化分页
                                        initPagination();
                                    } else {
                                        layer.msg('数据加载失败');
                                    }
                                },
                                error: function () {
                                    layer.msg('请求失败');
                                }
                            });
                        }

                        function renderData(data) {
                            let str = `<ul data-v-e2a11294="" class="user-jobs-ul">`;
                            for (let i = 0; i < data.list.length; i++) {
                                str += `    <li data-v-e2a11294="" class="item-boss">
      <div data-v-e2a11294="" class="item-content">
        <div data-v-e2a11294="" class="info-header"><!---->
          <div data-v-e2a11294="" class="btns"><!----><a data-v-e2a11294="" href="javascript:;"
                                                         ka="personal_interest_continue_7c87cffde6b7e1411nR83Ny4EFpS"
                                                         class="btn btn-startchat">继续沟通</a><!----><a data-v-e2a11294="" href="javascript:;"
                                                                                                         ka="personal_interest_cancel_7c87cffde6b7e1411nR83Ny4EFpS"
                                                                                                         class="btn btn-like">取消感兴趣</a><!----></div>
          <div data-v-e2a11294="" class="img-box"><img data-v-e2a11294=""
                                                       src="${data.list[i].jrAvatar}">
            <h3 data-v-e2a11294="" class="name"> ${data.list[i].contactPerson}<em data-v-e2a11294="" class="vline"></em>高级经理<!---->
            </h3>
          </div>
        </div>
        <div data-v-e2a11294="" class="info-primary flex-reverse info-primary-noninterview">
          <div data-v-e2a11294="" class="company-info"><img data-v-e2a11294=""
                                                            src="${data.list[i].jrAvatar}">
            <div data-v-e2a11294="" class="text"><b data-v-e2a11294=""><a data-v-e2a11294=""
                                                                          href="/dev/views/job/page/jobdetails.html?jrId=${data.list[i].jrId}"
                                                                          ka="personal_interest_brand_4e688f26febb7b191HVy29W7">${data.list[i].companyName}</a></b>
              <p data-v-e2a11294="" class="gray"><span data-v-e2a11294="">${data.list[i].companyType}</span><span
                      data-v-e2a11294="">A轮</span><span data-v-e2a11294="">${data.list[i].recruitsNum}</span></p>
            </div>
          </div>
          <div data-v-e2a11294="" class="job-info width-500">
            <div data-v-e2a11294="" class="job-name">
              <div data-v-e2a11294="" class="flex"><a data-v-e2a11294=""
                                                      href="/dev/views/job/page/boss.html?posId=${data.list[i].posId}"
                                                      class="name"><span data-v-e2a11294="">${data.list[i].posName}</span><span data-v-e2a11294=""
                                                                                                                           class="location">[${data.list[i].workPlace}]</span></a></div>
            </div>
            <p data-v-e2a11294="" class="gray"> ${data.list[i].pay} <span data-v-e2a11294=""> ${data.list[i].expDemand} </span> <span
                    data-v-e2a11294="">${data.list[i].background}</span></p>
          </div>
        </div>
      </div>
    </li>`
                            }
                            str += `</ul>`
                            let childElements = content.children
                            childElements[1].outerHTML = str;
                        }

                        // 初始化加载数据
                        loadData();
                    }
                })
            }
        )
    })

    function back() {
        window.location = '/dev/views/job/page/myuserinfo.html'
    }

    function submitFile() {
        window.location = '/dev/views/job/page/curriculum.html'
    }


    layui.use(function () {
        var $ = layui.$;
        var layer = layui.layer;
        var util = layui.util;
        var form = layui.form;
        // 事件
        util.on('lay-on', {
            'page-title': function () {
                layer.open({
                    type: 1,
                    area: ['630px', '569px'], // 宽高
                    title: false, // 不显示标题栏
                    closeBtn: 0,
                    skin: "compileJS",
                    shadeClose: true, // 点击遮罩关闭层
                    content: '<iframe src="/dev/views/common/mycompile.html" frameborder="0" style="width: 630px;height: 560px;border-radius: 10px"></iframe>',
                    end: function () {
                        location.reload()
                    }
                });
            }

        })
    });

    $(function (){
        $.ajax({
            headers:{
                "id":localStorage.getItem("id"),
                "token":localStorage.getItem("token")
            },
            url:'/dev/collect/userInfo',
            type: 'post',
            data:{
                // "jsId": localStorage.getItem("userId")
                "jsId": localStorage.getItem("id")
            },
            success:function (result){
                if (result.code==200){
                    console.log("个人数据")
                    console.log(result)
                  let cont = document.querySelector(".headimg")
                        document.querySelector(".headimg").src=result.data.avatar
                    cont.innerHTML=`<div data-v-7d3f5d0c="" class="username"><span data-v-7d3f5d0c=""
                                                               class="username">${result.data.jsName}</span></div>
                <div data-v-7d3f5d0c="" class="userinfo"> ${result.data.age}
              </div>`
                }
            }
        })
    })

</script>


</body>

</html>